# 遍历
str1="hello python"
for c in str1:
    print(c,end='')
print()
print(str1.find('ll'))
print(str1.replace('l','L',1))
# 分割
str_list=str1.split(' ')
print(str_list)
# 换行
str2='hello\nworld\nhow are you\ntoday is a good day'
str_list=str2.splitlines()
print(str_list)
# 拼接
str_result=' '.join(str_list)
print(str_result)
print()

# 反转
def str_reverse():
    str1='hello'
    my_list=list(str1)
    my_list.reverse()
    print(' '.join(my_list))
str_reverse()